<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<link rel="stylesheet" href="__static__/css/user.css" />
<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script language="javascript" src="__static__/common/sign.js"></script>
<script language="javascript"  src="__static__/common/json.js"></script>
<script language="javascript" src="__static__/common/md5.js"></script>
<script language="javascript" src="__static__/common/base64.js"></script>
<script language="javascript" src="__static__/js/url.js"></script>

<body>
<div class="lg-container">
    <h1>Register</h1>
    <form action="#" id="lg-form" name="lg-form" method="post">

        <div>
            <label for="username">Username:</label>
            <input type="text" name="username" id="username" placeholder="username"/>
        </div>

        <div>
            <label for="password">Password:</label>
            <input type="password" name="password" id="password" placeholder="password" />
        </div>

        <div>
            <label for="password">Password:</label>
            <input type="password" name="pass" id="pass" placeholder="set password" />
        </div>

        <div>
            <label for="password">Phone:</label>
            <input type="text" name="phone" id="phone" placeholder="phone" />
        </div>

        <div align="center">
            <button type="button" id="register" style="margin-right: 40px">Register</button>
            <button type="button" onclick="history.go(-1)">Reback</button>
        </div>

    </form>
    <div id="message"></div>
</div>

</body>

<!--ajax 登录-->
<script language="javascript" src="__static__/js/user.js"></script>
<script>
    $(function () {
        $('#register').click(function () {
            var username = $('#username').val();
            var password = $('#password').val();
            var pass = $('#pass').val();
            var phone = $('#phone').val();
            if(password!=pass){
                alert('两次输入密码不一致');
            }
            else if(password==''||pass==''){
                alert('密码不能为空');
            }
            else if(phone==''){
                alert('手机号码不能为空');
            }
            else {
                userRegister(username,password,phone);
            }
        })
    })
</script>

</html>